﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;

namespace MobileManager
{
    public partial class MMhome : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MM.Model.T_Users userModel;
            if (Session["CurUser"] == null)
            {
                Response.Redirect("Login.aspx");
                return;
            }
            else
            {
                userModel = (MM.Model.T_Users)Session["CurUser"];
                if (userModel.RoleID.Equals("3"))
                    return;
                lbUserInfo.Text = string.Format("{0}，欢迎您！", userModel.UserName);
            }
            if (!IsPostBack)
            {
                //string strUrl = Request.Url.ToString().Replace(Request.Path, "") + Request.ApplicationPath;
                StringBuilder sbHTML = new StringBuilder(500);
                sbHTML.Append("<ul>");
                sbHTML.Append(string.Format("<li class=\"item\" id=\"Index\"><a href=\"{0}\">主 页</a></li>", "Index.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"MODEPManage\"><a href=\"{0}\">短信管理</a></li>", "MODEPManage.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"MchannelManage\"><a href=\"{0}\">通道管理</a></li>", "MchannelManage.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"MruleManage\"><a href=\"{0}\">规则管理</a></li>", "MruleManage.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"SChanel\"><a href=\"{0}\">生产统计</a></li>", "SChanel.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"RT\"><a href=\"{0}\">分析报表</a></li>", "RTsimprovince.aspx"));
                sbHTML.Append(string.Format("<li class=\"item\" id=\"UserManager\"><a href=\"{0}\">系统管理</a></li>", "UserManager.aspx"));
                sbHTML.Append("</ul>");
                llMenu.Text = sbHTML.ToString();
            }
        }
    }
}
